using System.ComponentModel.DataAnnotations;

namespace VotingSystem.Models
{
    public class Question
    {
        public int Id { get; set; }

        [Required]
        public string QuestionText { get; set; } = string.Empty;

        public QuestionType Type { get; set; }

        public bool IsRequired { get; set; }

        public int Order { get; set; }

        public int SurveyId { get; set; }

        public Survey Survey { get; set; } = null!;

        public ICollection<QuestionOption> Options { get; set; } = new List<QuestionOption>();

        // 评分题特有属性
        public int? MinScore { get; set; }
        public int? MaxScore { get; set; }
        public string ScoreLabels { get; set; } = string.Empty;

        // 文件上传题特有属性
        public string AllowedFileTypes { get; set; } = string.Empty;
        public int? MaxFileSize { get; set; }

        // 简答题特有属性
        public int? MaxLength { get; set; }

        // 数值题特有属性
        public decimal? MinValue { get; set; }
        public decimal? MaxValue { get; set; }

        // 矩阵题特有属性
        public string RowTitles { get; set; } = string.Empty;
        public string ColumnTitles { get; set; } = string.Empty;

        public Question()
        {
            Options = new List<QuestionOption>();
        }
    }
} 